Generalized Arrows

نویسنده

  • Adam Megacz Joseph
چکیده

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission. Abstract Generalized Arrows Multi-level languages and arrows both facilitate metaprogramming, the act of writing a program which generates a program. The arr function required of all arrows turns arbitrary metalanguage expressions into object language expressions; because of this, arrows may be used for metaprogramming only when the object language is a superset of the metalanguage. This thesis introduces generalized arrows, which are less restrictive than arrows in that they impose no containment relationship between the object language and metalanguage; this allows generalized arrows to be used for heterogeneous metaprogramming. This thesis also establishes a correspondence between two-level programs and one-level programs which take a generalized arrow instance as a distinguished parameter. A translation across this correspondence is possible, and is called a flattening transformation. The flattening translation is not specific to any particular object language; this means that it needs to be implemented only once for a given metalanguage compiler. Support for various object languages can then be added by implementing instances of the generalized arrow type class; this does not require knowledge of compiler internals. Because of the flattening transformation the users of these object languages are able to program using convenient multi-level types and syntax; the conversion to one-level terms manipulating generalized arrow instances is handled by the flattening transformation. A modified version of the Glasgow Haskell Compiler (GHC) with multi-level types and expressions has been produced as a proof of concept. The Haskell extraction of the Coq formalization in this thesis have been compiled into this modified GHC as a new flattening pass.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Multi-Level Languages are Generalized Arrows

Multi-level languages and Arrows both facilitate metaprogramming, the act of writing a program which generates a program. The arr function required of all Arrows turns arbitrary host language expressions into guest language expressions; because of this, Arrows may be used for metaprogramming only when the guest language is a superset of the host language. This restriction is also present in mul...

متن کامل

Hardware Design with Generalized Arrows

Instances of the GArrow type class (Figure 2) are called generalized arrows. The GArrow class generalizes Control.Arrow by allowing any type-level monoid to take the place of the cartesian product (,) and by replacing arr with the “structural” functions usually defined in terms of it. Multi-level terms with environment classifier types [TN03] may be flattened into single-level terms parameteriz...

متن کامل

Multi-Stage Programs are Generalized Arrows

The lambda calculus, subject to typing restrictions, provides a syntax for the internal language of cartesian closed categories. This paper establishes a parallel result: staging annotations [? ], subject to named level restrictions, provide a syntax for the internal language of Freyd categories, which are known to be in bijective correspondence with Arrows. The connection is made by interpreti...

متن کامل

The Lusternik-schnirelmann Category of a Lie Groupoid

We propose a new homotopy invariant for Lie groupoids which generalizes the classical Lusternik-Schnirelmann category for topological spaces. We use a bicategorical approach to develop a notion of contraction in this context. We propose a notion of homotopy between generalized maps given by the 2-arrows in a certain bicategory of fractions. This notion is invariant under Morita equivalence. Thu...

متن کامل

Accelerated phase of Chediak-Higashi syndrome.

A 18-month-old girl with a diagnosis of Chediak-Higashi syndrome (CHS) presented with severe bacterial skin infection. Recurrent episodes of bacterial infections began at the age of 2 months. On physical examination, generalized lymphadenopathy, hepatosplenomegaly, skin hypopigmentation, and silvery hair were noted. Bone marrow aspirate revealed prominent granules (top left and right) within th...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014